package com.gz.logistics.library.pojo;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * 未签收仓库商品列表
 * 杜志娟
 */
public class WillOutStorageAassembleY {
    private int storehouse_id;//仓库id

    public int getStorehouse_id() {
        return storehouse_id;
    }
    private String sign_at;//签收时间

    public String getSign_at() {
        return sign_at;
    }

    public void setSign_at(String sign_at) {
        this.sign_at = sign_at;
    }

    public void setStorehouse_id(int storehouse_id) {
        this.storehouse_id = storehouse_id;
    }

    public String getStorehouse_name() {

        return storehouse_name;
    }

    public void setStorehouse_name(String storehouse_name) {
        this.storehouse_name = storehouse_name;
    }

    private String storehouse_name;//仓库的名称



    private List<WillOutStorageProdoctInfo> willOutPrducts;



    public List<WillOutStorageProdoctInfo> getWillOutPrducts() {
        return willOutPrducts;
    }

    public void setWillOutPrducts(List<WillOutStorageProdoctInfo> willOutPrducts) {
        this.willOutPrducts = willOutPrducts;
    }



    public static List<WillOutStorageAassembleY> parse(JSONArray jsonArray) throws JSONException {
        if (jsonArray == null || jsonArray.length() <= 0){
            return null;
        }

        List<WillOutStorageAassembleY> aassembles = new ArrayList<WillOutStorageAassembleY>();
        for (int i = 0 ; i < jsonArray.length() ; i++){

            WillOutStorageAassembleY assemble = new WillOutStorageAassembleY();
            JSONObject object = jsonArray.getJSONObject(i);
            assemble.storehouse_id= object.getInt("storehouse_id");
            assemble.storehouse_name = object.getString("storehouse_name");
            assemble.sign_at = object.getString("sign_at");
            assemble.willOutPrducts = WillOutStorageProdoctInfo.parse(object.getJSONArray("products"));

            aassembles.add(assemble);
        }
        return aassembles;

    }


}
